package com.zky.group.grouphead.feign;

import com.zky.common.entity.GroupEntity;
import com.zky.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

@FeignClient("group-pintuan")
@RequestMapping("grouppintuan/pintuan")
public interface GroupFeignService {

    /**
     * 拼团接口
     * @param group
     * @return
     */

    /**
     * 列表
     */
    @RequestMapping("/list")
//    @RequiresPermissions("grouppintuan:group:list")
    public R list(@RequestParam Map<String, Object> params);


    /**
     * 信息
     */
    @RequestMapping("/info/{groupId}")
//    @RequiresPermissions("grouppintuan:group:info")
    public R info(@PathVariable("groupId") Long groupId);

    /**
     * 保存
     */
    @RequestMapping("/save")
//    @RequiresPermissions("grouppintuan:group:save")
    public R save(@RequestBody GroupEntity group);

    /**
     * 修改
     */
    @RequestMapping("/update")
//    @RequiresPermissions("grouppintuan:group:update")
    public R update(@RequestBody GroupEntity group);

    /**
     * 删除
     */
    @RequestMapping("/delete")
//    @RequiresPermissions("grouppintuan:group:delete")
    public R delete(@RequestBody Long[] groupIds);


    //图片上传
    @RequestMapping("/tup")
    public R tup(MultipartFile file);


}
